<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<html>
<head>
    <title>项目管理</title>
    <script>
        function addRefrigeration() {
            location.href = "/xg/update";
        }

        function addExcutor() {
            location.href = "/excutor/list";
        }
    </script>
</head>
<body>
<div style="width: 100%;margin: auto">
    <button class="btn btn-default" onclick="addRefrigeration()">
        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>添加项目
    </button>
    <%--<sec:authorize access="hasAuthority('XG_MANAGEMENT')">--%>
    <button class="btn btn-default" onclick="addExcutor()">
        <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>项目人员管理
    </button>
    <%--</sec:authorize>--%>
    <table class="table table-hover">
        <thead>
        <th width="20%">项目日期</th>
        <th width="20%">项目名称</th>
        <th width="15%">项目收入（￥）</th>
        <th width="10%">项目支出（￥）</th>
        <th width="15%">项目余额（￥）</th>
        <th width="10%">项目人员</th>
        <th width="15%">操作</th>
        </thead>
        <tbody>
        <c:forEach items="${refrigerationDTOs}" var="refrigerationDTO">
            <tr>
                <td>${refrigerationDTO.date}</td>
                <td>${refrigerationDTO.project}</td>
                <td>${refrigerationDTO.income}</td>
                <td>${refrigerationDTO.expenditure}</td>
                <td>${refrigerationDTO.balance}</td>
                <td>${refrigerationDTO.excutor.name}</td>
                <td>
                    <a href="/xg/update?id=${refrigerationDTO.id}">修改</a>|
                    <a href="/xg/del/${refrigerationDTO.id}">删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
        <tr class="active">
            <td><b>合计</b></td>
            <td><b>/</b></td>
            <td><b>${allIncome}</b></td>
            <td><b>${allExpenditure}</b></td>
            <td><b>${allBalance}</b></td>
            <td><b>/</b></td>
            <td><b>/</b></td>
        </tr>
    </table>
</div>
</body>
</html>
